#pragma once

#if CR_DEBUG_OUTPUT_ENABLED

namespace cr_debug
{
	void OutputString(const char* szMessage, ...);
}

#define CR_OUTPUT_STRING(m)						cr_debug::OutputString(m)
#define CR_OUTPUT_STRING1(m, a1)				cr_debug::OutputString(m, a1)
#define CR_OUTPUT_STRING2(m, a1, a2)			cr_debug::OutputString(m, a1, a2)
#define CR_OUTPUT_STRING3(m, a1, a2, a3)		cr_debug::OutputString(m, a1, a2, a3)
#define CR_OUTPUT_STRING4(m, a1, a2, a3, a4)	cr_debug::OutputString(m, a1, a2, a3, a4)

#define CR_ERROR_STRING(m)						{ CR_OUTPUT_STRING(m);					CR_HALT(); } 
#define CR_ERROR_STRING1(m, a1)					{ CR_OUTPUT_STRING1(m, a1);				CR_HALT(); } 
#define CR_ERROR_STRING2(m, a1, a2)				{ CR_OUTPUT_STRING2(m, a1, a2);			CR_HALT(); } 
#define CR_ERROR_STRING3(m, a1, a2, a3)			{ CR_OUTPUT_STRING3(m, a1, a2, a3);		CR_HALT(); } 
#define CR_ERROR_STRING4(m, a1, a2, a3, a4)		{ CR_OUTPUT_STRING4(m, a1, a2, a3, a4);	CR_HALT(); } 

#else

#define CR_OUTPUT_STRING(m)						
#define CR_OUTPUT_STRING1(m, a1)				
#define CR_OUTPUT_STRING2(m, a1, a2)			
#define CR_OUTPUT_STRING3(m, a1, a2, a3)		
#define CR_OUTPUT_STRING4(m, a1, a2, a3, a4)	

#define CR_ERROR_STRING(m)						
#define CR_ERROR_STRING1(m, a1)					
#define CR_ERROR_STRING2(m, a1, a2)				
#define CR_ERROR_STRING3(m, a1, a2, a3)			
#define CR_ERROR_STRING4(m, a1, a2, a3, a4)		

#endif // CR_DEBUG_OUTPUT_ENABLED